package com.aivin.lib_login;

import android.content.Context;

import com.aivin.lib_base.tool.RouteUtils;
import com.aivin.lib_base.tool.WkLog;
import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.annotation.Interceptor;
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
import com.alibaba.android.arouter.facade.template.IInterceptor;

@Interceptor( priority = 8 , name = "登录检验拦截器")
public class LoginInterceptor implements IInterceptor {
    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        callback.onContinue(postcard); //不拦截
       /* boolean isLogined =  false;
        if (isLogined) {
            callback.onContinue(postcard); //不拦截
        } else {
            String path = postcard.getPath();
            switch (path) {
                case  RouteUtils.EnglishListActivity:
                    callback.onInterrupt( new RuntimeException("还未登录")); //需要登陆拦截
                    break;
                default:
                    callback.onContinue(postcard); //不拦截
                    break;
            }
        }*/
    }

    @Override
    public void init(Context context) {
        // 会在sdk初始化的时候调用该方法
    }
}
